package com.alm.token.ui.persenter;

import android.content.Context;
import android.widget.Toast;

import com.alm.token.api.ApiService;

import rx.Observable;
import rx.Subscriber;
import rx.schedulers.Schedulers;
import rx.subscriptions.CompositeSubscription;

/**
 * Created by PDD on 2017/12/22.
 */

public class BasePresenter {
//    public ApiService apiStores = AppClient.retrofit().create(ApiService.class);
//    private CompositeSubscription mCompositeSubscription;

    /**
     * 签名
     *
     * @return
     */
    public void addSubscription(Observable observable, Subscriber subscriber) {

//        if (mCompositeSubscription == null) {
//            mCompositeSubscription = new CompositeSubscription();
//        }
//        mCompositeSubscription.add(
//                observable
//                        .subscribeOn(Schedulers.io())
//                        .observeOn(AndroidSchedulers.mainThread())
//                        .subscribe(subscriber));

    }

    public void onUnsubscribe() {
//        if (mCompositeSubscription != null && mCompositeSubscription.hasSubscriptions()) {
//            mCompositeSubscription.unsubscribe();
//        }
    }

}
